<template>
  <div class="org_person">
    <div class="org_person_left">
      <div class="org_person_left_info">
        <el-scrollbar class="full_height">
          <div
            @click="orgCli(item)"
            class="org-task__item"
            :class="{ active: item.id == cycleActiveObjId }"
            v-for="item in dataList"
            :key="item.id">
            <p class="org-name">{{ item.name }}</p>
          </div>
        </el-scrollbar>
      </div>
    </div>
  </div>
</template>

<script>
import { getWindowList } from '@apis/api-dailyManage.js'
export default {
  components: {},
  props: {},
  data() {
    return {
      dataList: [],
      tenantId: localStorage.pskh_tenantId,
      taskOrgId: sessionStorage.taskOrgId,
      cycleActiveObjId: '',
      cycleActiveObjName: '',
      personId: '',
    }
  },
  watch: {},
  computed: {},
  created() {
    this.getWindowList()
  },
  mounted() {},
  methods: {
    orgCli(item, index) {
      this.cycleActiveObjId = item.id
      this.cycleActiveObjName = item.name
      this.$emit('onClickChangeClick', item)
    },
    getWindowList() {
      getWindowList().then(res => {
        if (res.code === 0) {
          const obj = {
            id: '',
            name: '全部窗口',
          }
          this.dataList = [obj, ...res.data]
          this.$emit('onClickChangeClick', obj)
        }
      })
    },
  },
}
</script>

<style lang="scss" scoped>
.org_person {
  width: 100%;
  height: 100%;
  font-size: 14px;
  .org_person_left {
    height: 100%;
    border: 1px solid #dcdfe6;
    background-color: #f3f7f9;
  }
  .org_person_left_info {
    height: 100%;
    .org-task__item {
      border-bottom: 1px solid #ddd;
      cursor: pointer;
      padding: 15px;
      .org-name {
        font-size: 14px;
        font-weight: 600;
      }
      &:hover,
      &.active {
        color: #fff;
        background: #1852a3;
        span,
        /deep/.el-progress__text {
          color: #fff;
        }
      }
    }
  }
}
</style>
